# kompute 库仓库地址 https://github.com/KomputeProject/kompute/
# kompute 文档网址 https://kompute.cc/
# kompute api ref 网址  https://kompute.cc/doxygen/annotated.html

# 添加子模块示例命令： git submodule add https://github.com/chaconinc/DbConnector
# 子模块及其嵌套子模块初始化示例命令： git submodule update --init --recursive
# 子模块分支跟踪设定示例命令(-f是强制到远程仓库)： git config -f .gitmodules submodule.DbConnector.branch stable; git submodule update --remote;
# git新版更改子模块branch：git submodule set-branch (-b|--branch) <branch> [--] <path> 或删除 set-branch (-d|--default) [--] <path> 
# git新版更改子模块url: git submodule set-url [--] <path> <newurl> 

kompute_path = $${PWD}/kompute/src

INCLUDEPATH += $${kompute_path}/include \

HEADERS += \
            $${kompute_path}/include/kompute/*.hpp  \
            $${kompute_path}/include/kompute/shaders/*.hpp  \
            $${kompute_path}/include/kompute/operations/*.hpp  \


SOURCES += \
            $${kompute_path}/Algorithm.cpp \
            $${kompute_path}/Manager.cpp \
            $${kompute_path}/OpAlgoDispatch.cpp \
            $${kompute_path}/OpMemoryBarrier.cpp \
            $${kompute_path}/OpTensorCopy.cpp \
            $${kompute_path}/OpTensorSyncDevice.cpp \
            $${kompute_path}/OpTensorSyncLocal.cpp \
            $${kompute_path}/Sequence.cpp \
            $${kompute_path}/Tensor.cpp \


DEFINES += \
           KOMPUTE_ENABLE_SPDLOG \ #  是否使用spdlog
           KOMPUTE_VK_API_MAJOR_VERSION=1 \ # 设定使用的vulkan主要版本
           KOMPUTE_VK_API_MINOR_VERSION=1 \ # 设定使用的vulkan次要版本
#           KOMPUTE_LOG_OVERRIDE \ # 是否使用自定的log宏替代kompute的默认宏

KOMPUTE_LOG_LEVEL_TRACE = 0
KOMPUTE_LOG_LEVEL_DEBUG = 1
KOMPUTE_LOG_LEVEL_INFO = 2
KOMPUTE_LOG_LEVEL_WARN = 3
KOMPUTE_LOG_LEVEL_ERROR = 4
KOMPUTE_LOG_LEVEL_CRITICAL = 5
KOMPUTE_LOG_LEVEL_OFF = 6

SPDLOG_LEVEL_TRACE = 0
SPDLOG_LEVEL_DEBUG = 1
SPDLOG_LEVEL_INFO = 2
SPDLOG_LEVEL_WARN = 3
SPDLOG_LEVEL_ERROR = 4
SPDLOG_LEVEL_CRITICAL = 5
SPDLOG_LEVEL_OFF = 6

CONFIG(debug, debug|release){

KOMPUTE_LOG_LEVEL = KOMPUTE_LOG_LEVEL_DEBUG
SPDLOG_ACTIVE_LEVEL = SPDLOG_LEVEL_DEBUG

DEFINES += DEBUG \
           KOMPUTE_LOG_LEVEL=$$KOMPUTE_LOG_LEVEL \  #日志级别构建过滤，小于设定值不构建日志实现函数
           SPDLOG_ACTIVE_LEVEL=$$SPDLOG_LEVEL_DEBUG \ #spdlog编译宏函数级别，小于设定级别不编译

#message($$DEFINES)
}else{
KOMPUTE_LOG_LEVEL = KOMPUTE_LOG_LEVEL_WARN
SPDLOG_ACTIVE_LEVEL = SPDLOG_LEVEL_WARN
DEFINES += RELEASE \
           KOMPUTE_LOG_LEVEL=$$KOMPUTE_LOG_LEVEL_WARN \
           SPDLOG_ACTIVE_LEVEL=$$SPDLOG_LEVEL_WARN \


}
#contains(DEFINES, KOMPUTE_ENABLE_SPDLOG){
#contains(DEFINES, KOMPUTE_LOG_OVERRIDE){
#LLEVEL = $$eval($$KOMPUTE_LOG_LEVEL)
#message($$LLEVEL)
#}
#}


